#ifndef foodview_h
#define foodview_h

#include <cmath>
#include <iostream>
#include <sstream>
#include "juce_amalgamated.h"
#include "../FoodObjects/Food.h"
#include "EatableView.h"
#include "../MiscGraphics.h"
#include "../TextField.h"

using std::stringstream;

//class FoodListSlider;

class ServingAmount {
public:
	ServingAmount(float v, String s) : value(v), str(s) {}
	float value;
	String str;
};

class FoodView: public EatableView {
private:

	Graphics* graphics;
	Image* fatIcon;
	Image* carbIcon;
	Image* proteinIcon;
//	DropShadowEffect shadow;

//	FoodListSlider* slider;
	float fat, carb, protein;
	float portion;

	TextField* portionField;

public:
	FoodView(Image* fIcon, Image* cIcon, Image* pIcon);
	~FoodView();
	void calculateRatios();
	void paintExtra(Graphics& g);
	void drawFoodInformation(Graphics& g);
	void resized();
	ServingAmount interpretServingAmount(String& desc, float factor);
	void setServingPortion(float value);
};

#endif
